<template>
  <div class="dashboard-container">
    <new-agent-view v-if="roleChar=='DAILI_ADMIN'"></new-agent-view>
    <new-oem-view v-if="roleChar=='OEM_ADMIN'"></new-oem-view>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

import newOemView from '@/components/oemView/newIndex'
import newAgentView from '@/components/agentView/newIndex'

export default {
  name: 'Home',
  components:{
    newAgentView,
    newOemView
  },
  data(){
    return {
      roleChar: '',
    }
  },
  mounted(){
    this.roleChar = localStorage.getItem("roleChar");
    let item = localStorage.getItem('theme')

    // if(window.name == "login"){
    //   window.name = "isFirstVisit";
    //   location.reload()
    // }
    // else if(window.name == "showNotice"){
    //   window.name = "isFirstVisit";
    // }
    // else if(window.name == "isFirstVisit"){
    //   localStorage.removeItem('noticeList')
    // }
    if(window.name == "showNotice"){
      window.name = "isFirstVisit";
    }
    else if(window.name == "isFirstVisit"){
      localStorage.removeItem('noticeList')
    }
   
  },

  computed: {
    ...mapGetters([
      'name',
      'roles'
    ])
  },
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
